package com.pencilisland.pay.mgt.console.repository;

import java.util.List;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.pencilisland.pay.mgt.console.entity.SysAuth;

public interface AuthRepository extends CrudRepository<SysAuth, Long> {

	List<SysAuth> findByPObjIdAndPObjTypeAndPType(Long pobjId, String pobjType, String pType);

	@Modifying
	@Query("delete from SysAuth a where a.pObjId=?1 and a.pObjType=?2 and a.pType=?3")
	void delByPObjIdAndPObjTypeAndPType(Long pobjId, String pobjType, String pType);

	List<SysAuth> findByPObjIdAndPObjTypeAndMenuId(Long objId, String objType, Long menuId);

}
